import { IPSAppDEDataSet } from '../dataentity/ipsapp-dedata-set';
import { IPSAppDEField } from '../dataentity/ipsapp-defield';
import { IPSAppDataEntity } from '../dataentity/ipsapp-data-entity';
import { IPSAppDEDataSetViewMsg } from './ipsapp-dedata-set-view-msg';
import { PSAppViewMsgImpl } from './psapp-view-msg-impl';

export class PSAppDEDataSetViewMsgImpl extends PSAppViewMsgImpl implements IPSAppDEDataSetViewMsg {
  get cacheScope(): 'GLOBAL' {
    return this.M.cacheScope;
  }

  protected cachetag2psappdefield: IPSAppDEField | null = null;

  getCacheTag2PSAppDEField(): IPSAppDEField | null {
    if (this.cachetag2psappdefield != null) return this.cachetag2psappdefield;
    const value = this.M.getCacheTag2PSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.cachetag2psappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.cachetag2psappdefield;
  }

  get cacheTag2PSAppDEField(): IPSAppDEField | null {
    return this.getCacheTag2PSAppDEField();
  }

  getCacheTag2PSAppDEFieldMust(): IPSAppDEField {
    const value = this.getCacheTag2PSAppDEField();
    if (value == null) {
      throw new Error('未指定缓存标记2应用实体属性对象');
    }
    return value;
  }

  protected cachetagpsappdefield: IPSAppDEField | null = null;

  getCacheTagPSAppDEField(): IPSAppDEField | null {
    if (this.cachetagpsappdefield != null) return this.cachetagpsappdefield;
    const value = this.M.getCacheTagPSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.cachetagpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.cachetagpsappdefield;
  }

  get cacheTagPSAppDEField(): IPSAppDEField | null {
    return this.getCacheTagPSAppDEField();
  }

  getCacheTagPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getCacheTagPSAppDEField();
    if (value == null) {
      throw new Error('未指定缓存标记应用实体属性对象');
    }
    return value;
  }

  get cacheTimeout(): number {
    return this.M.cacheTimeout;
  }

  protected contentpsappdefield: IPSAppDEField | null = null;

  getContentPSAppDEField(): IPSAppDEField | null {
    if (this.contentpsappdefield != null) return this.contentpsappdefield;
    const value = this.M.getContentPSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.contentpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.contentpsappdefield;
  }

  get contentPSAppDEField(): IPSAppDEField | null {
    return this.getContentPSAppDEField();
  }

  getContentPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getContentPSAppDEField();
    if (value == null) {
      throw new Error('未指定消息内容应用实体属性对象');
    }
    return value;
  }

  protected msgpospsappdefield: IPSAppDEField | null = null;

  getMsgPosPSAppDEField(): IPSAppDEField | null {
    if (this.msgpospsappdefield != null) return this.msgpospsappdefield;
    const value = this.M.getMsgPosPSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.msgpospsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.msgpospsappdefield;
  }

  get msgPosPSAppDEField(): IPSAppDEField | null {
    return this.getMsgPosPSAppDEField();
  }

  getMsgPosPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getMsgPosPSAppDEField();
    if (value == null) {
      throw new Error('未指定显示位置应用实体属性对象');
    }
    return value;
  }

  protected msgtypepsappdefield: IPSAppDEField | null = null;

  getMsgTypePSAppDEField(): IPSAppDEField | null {
    if (this.msgtypepsappdefield != null) return this.msgtypepsappdefield;
    const value = this.M.getMsgTypePSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.msgtypepsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.msgtypepsappdefield;
  }

  get msgTypePSAppDEField(): IPSAppDEField | null {
    return this.getMsgTypePSAppDEField();
  }

  getMsgTypePSAppDEFieldMust(): IPSAppDEField {
    const value = this.getMsgTypePSAppDEField();
    if (value == null) {
      throw new Error('未指定消息类型标记应用实体属性对象');
    }
    return value;
  }

  protected ordervaluepsappdefield: IPSAppDEField | null = null;

  getOrderValuePSAppDEField(): IPSAppDEField | null {
    if (this.ordervaluepsappdefield != null) return this.ordervaluepsappdefield;
    const value = this.M.getOrderValuePSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.ordervaluepsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.ordervaluepsappdefield;
  }

  get orderValuePSAppDEField(): IPSAppDEField | null {
    return this.getOrderValuePSAppDEField();
  }

  getOrderValuePSAppDEFieldMust(): IPSAppDEField {
    const value = this.getOrderValuePSAppDEField();
    if (value == null) {
      throw new Error('未指定显示次序应用实体属性对象');
    }
    return value;
  }

  protected psappdedataset: IPSAppDEDataSet | null = null;

  getPSAppDEDataSet(): IPSAppDEDataSet | null {
    if (this.psappdedataset != null) return this.psappdedataset;
    const value = this.M.getPSAppDEDataSet;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.psappdedataset = ipsappdataentity.findPSAppDEDataSet(value);
    }
    return this.psappdedataset;
  }

  get psAppDEDataSet(): IPSAppDEDataSet | null {
    return this.getPSAppDEDataSet();
  }

  getPSAppDEDataSetMust(): IPSAppDEDataSet {
    const value = this.getPSAppDEDataSet();
    if (value == null) {
      throw new Error('未指定应用实体数据集合对象');
    }
    return value;
  }

  protected psappdataentity: IPSAppDataEntity | null = null;

  getPSAppDataEntity(): IPSAppDataEntity | null {
    if (this.psappdataentity != null) return this.psappdataentity;
    const value = this.M.getPSAppDataEntity;
    if (value == null) {
      return null;
    }
    this.psappdataentity = this.getPSModel4('app.dataentity.IPSAppDataEntity', value, 'getPSAppDataEntity') as IPSAppDataEntity;
    return this.psappdataentity;
  }

  get psAppDataEntity(): IPSAppDataEntity | null {
    return this.getPSAppDataEntity();
  }

  getPSAppDataEntityMust(): IPSAppDataEntity {
    const value = this.getPSAppDataEntity();
    if (value == null) {
      throw new Error('未指定应用实体对象');
    }
    return value;
  }

  protected removeflagpsappdefield: IPSAppDEField | null = null;

  getRemoveFlagPSAppDEField(): IPSAppDEField | null {
    if (this.removeflagpsappdefield != null) return this.removeflagpsappdefield;
    const value = this.M.getRemoveFlagPSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.removeflagpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.removeflagpsappdefield;
  }

  get removeFlagPSAppDEField(): IPSAppDEField | null {
    return this.getRemoveFlagPSAppDEField();
  }

  getRemoveFlagPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getRemoveFlagPSAppDEField();
    if (value == null) {
      throw new Error('未指定移除标志应用实体属性对象');
    }
    return value;
  }

  protected titlelanrestagpsappdefield: IPSAppDEField | null = null;

  getTitleLanResTagPSAppDEField(): IPSAppDEField | null {
    if (this.titlelanrestagpsappdefield != null) return this.titlelanrestagpsappdefield;
    const value = this.M.getTitleLanResTagPSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.titlelanrestagpsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.titlelanrestagpsappdefield;
  }

  get titleLanResTagPSAppDEField(): IPSAppDEField | null {
    return this.getTitleLanResTagPSAppDEField();
  }

  getTitleLanResTagPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getTitleLanResTagPSAppDEField();
    if (value == null) {
      throw new Error('未指定抬头语言标记应用实体属性对象');
    }
    return value;
  }

  protected titlepsappdefield: IPSAppDEField | null = null;

  getTitlePSAppDEField(): IPSAppDEField | null {
    if (this.titlepsappdefield != null) return this.titlepsappdefield;
    const value = this.M.getTitlePSAppDEField;
    if (value == null) {
      return null;
    }
    const ipsappdataentity = this.getPSAppDataEntity();
    if (ipsappdataentity != null) {
      this.titlepsappdefield = ipsappdataentity.findPSAppDEField(value);
    }
    return this.titlepsappdefield;
  }

  get titlePSAppDEField(): IPSAppDEField | null {
    return this.getTitlePSAppDEField();
  }

  getTitlePSAppDEFieldMust(): IPSAppDEField {
    const value = this.getTitlePSAppDEField();
    if (value == null) {
      throw new Error('未指定抬头应用实体属性对象');
    }
    return value;
  }

  get enableCache(): boolean {
    return this.M.enableCache;
  }

  get cls(): string {
    return 'PSAppDEDataSetViewMsgImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'app.view.IPSAppDEDataSetViewMsg' || cls == 'view.IPSDEDataSetViewMsg') return true;
    return super.instanceof(cls);
  }
}
